define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'system.village/index',
        add_url: 'system.village/add',
        edit_url: 'system.village/edit',
        delete_url: 'system.village/delete',
        export_url: 'system.village/export',
        modify_url: 'system.village/modify',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', search: false, title: 'id'},
                    {field: 'name', title: '名称'},
                    {field: 'image',search: false, title: '图片', templet: ea.table.image},
                    {field: 'status',title: '状态', search: 'select', selectList: {0: '禁用', 1: '启用'},templet: ea.table.switch},
                    {field: 'remark',search: false, title: '备注说明', maxWidth: 250, templet: ea.table.text},
                    {field: 'sort',search: false, title: '排序', edit: 'text'},
                    {field: 'create_time', search: false, title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
});